import counsellorRouter from './routerApi/counsellorRouter'
import schoolRouter from './routerApi/schoolRouter'
import collegeRouter from './routerApi/collegeRouter'
import studentRouter from './routerApi/studentRouter'
const loginPage = [
  {
    path: '/login',
    name: 'login',
    component: () =>
      import(/* webpackChunkName: "Login" */ '../pages/login/Login')
  }
]

const mainPage = [
  {
    path: '/',
    redirect: '/main'
  },
  {
    path: '/printPreview',
    name: 'printPreview',
    component: () =>
      import(/* webpackChunkName: "printPreview" */ '../pages/main/components/printPreview')
  },
  {
    path: '/main',
    name: 'main',
    component: () =>
      import(/* webpackChunkName: "Main" */ '../pages/main/Main'),
    children: [
      // admin超级管理员用户
      {
        path: 'peopleManagement',
        name: 'peopleManagement',
        component: () =>
          import(/* webpackChunkName: "PeopleManagement" */ '../pages/main/routes/peopleManagement/PeopleManagement')
      },
      {
        path: 'roleManagement',
        name: 'roleManagement',
        component: () =>
          import(/* webpackChunkName: "RoleManagement" */ '../pages/main/routes/roleManagement/RoleManagement')
      },
      {
        path: 'integratedManagement',
        name: 'integratedManagement',
        component: () =>
          import(/* webpackChunkName: "IntegratedManagement" */ '../pages/main/routes/integratedManagement/IntegratedManagement')
      },
      {
        path: 'permissionManagement',
        name: 'permissionManagement',
        component: () =>
          import(/* webpackChunkName: "permissionManagement" */ '../pages/main/routes/permissionManage/index'),
        children: [
          {
            path: '/main/permissionManagement/roleManage',
            name: 'roleManage',
            component: () =>
              import(/* webpackChunkName: "roleTypeManage" */ '../pages/main/routes/permissionManage/roleManage')
          },
          // 应用管理
          {
            path: '/main/permissionManagement/applicationManage',
            component: () => import('../pages/main/routes/permissionManage/appManage/index'),
            name: 'applicationManage',
            children: [
              // 应用
              {
                path: '/main/permissionManagement/applicationManage/app',
                name: 'app',
                meta: {
                  breadcrumb: ['应用管理']
                },
                component: () => import('../pages/main/routes/permissionManage/appManage/app')
              },
              // 分类
              {
                path: '/main/permissionManagement/applicationManage/classify',
                name: 'classify',
                meta: {
                  breadcrumb: ['应用管理']
                },
                component: () => import('../pages/main/routes/permissionManage/appManage/classify')
              }

            ]
          },
          {
            path: '/main/permissionManagement/roleManage/addApplications',
            name: 'roleManageAddApplications',
            component: () =>
              import(/* webpackChunkName: "roleManageAddApplications" */ '../pages/main/routes/permissionManage/addApplication')
          },
          // {
          //   path: '/main/permissionManagement/applicationManage',
          //   name: 'applicationManage',
          //   component: () =>
          //     import(/* webpackChunkName: "applicationManage" */ '../pages/main/routes/permissionManage/applicationManage')
          // },
          {
            path: '/main/permissionManagement/applicationManage/applicationDetail',
            name: 'applicationDetail',
            component: () =>
              import(/* webpackChunkName: "applicationDetail" */ '../pages/main/routes/permissionManage/applicationDetail')
          },

          {
            path: '/main/permissionManagement/interfaceManage',
            name: 'interfaceManage',
            component: () =>
              import(/* webpackChunkName: "interfaceManage" */ '../pages/main/routes/permissionManage/interfaceManage')
          }
        ]
      },
      // 系统配置
      // {
      //   path: 'systemMaintenance',
      //   name: 'systemMaintenance',
      //   component: () =>
      //     import(/* webpackChunkName: "systemMaintenance" */ '../pages/main/routes/systemMaintenance/systemMaintenance')
      // },
      // 新增学校
      {
        path: 'school',
        name: 'school',
        redirect: 'school/personalInfo',
        component: () =>
          import(/* webpackChunkName: "school" */ '../pages/main/routes/school/personalInfo'),
        children: schoolRouter
      },
      // 新增学院
      {
        path: 'college',
        name: 'college',
        redirect: 'college/collegeManage',
        component: () =>
          import(/* webpackChunkName: "college" */ '../pages/main/routes/college/personalInfo'),
        children: collegeRouter
      },
      // 新增辅导员
      {
        path: 'counsellor',
        name: 'counsellor',
        redirect: 'counsellor/counsellorInfo',
        component: () =>
          import(/* webpackChunkName: "counsellorExamine" */ '../pages/main/routes/counsellor/examineInfo'),
        children: counsellorRouter
      },
      // 新增学生
      {
        path: 'student',
        name: 'student',
        redirect: 'student/studentInfo',
        component: () =>
          import(/* webpackChunkName: "counsellorExamine" */ '../pages/main/routes/counsellor/examineInfo'),
        children: studentRouter
      }
    ]
  }
]

const errorPage = [
  {
    path: '/notFound',
    name: 'notFound',
    component: () =>
      import(/* webpackChunkName: "NotFound" */ '../pages/error/NotFound')
  },
  {
    path: '/forbidden',
    name: 'forbidden',
    component: () =>
      import(/* webpackChunkName: "Forbidden" */ '../pages/error/Forbidden')
  },
  {
    path: '/badGateway',
    name: 'badGateway',
    component: () =>
      import(/* webpackChunkName: "BadGateway" */ '../pages/error/BadGateway')
  },
  {
    path: '*',
    redirect: '/notFound'
  }
]
export default [...loginPage, ...mainPage, ...errorPage]
